Added GHE enterprise connection option#25
Conversation
|
Can one of the admins verify this patch? |
rmg
left a comment
There was a problem hiding this comment.
Given this code, I would expect the majority of this PR to be the ~10 or so lines that are added to the README.md and only a few lines needing to be added to the actual code.
| { | ||
| "username": "github-username", | ||
| "password": "github-password", | ||
| "enterprise_host": "github.your-GHE-company.com" |
There was a problem hiding this comment.
Since GHE exposes the same API and all of the clients treat it exactly the same, it would be better to just have a single GH URL option that simply defaults to https://api.github.com/.
There was a problem hiding this comment.
So have a field for the host with api.github.com and allow it to be changed? Because the current way it works is it defaults to api.github.com if no enterprise_host is specified.
| if (ghe_host) { | ||
| console.info("Connecting to GitHub Enterprise (" + ghe_host + ")..") | ||
| github_params.host = ghe_host; | ||
| github_params.pathPrefix = "/api/v3" |
There was a problem hiding this comment.
This is part of the company specific URL and admins are actually free to use just about whatever root URL they like, so this is pretty specific to one company's GHE deployment.
There was a problem hiding this comment.
Would I have the user specify the pathPrefix as well then?
There was a problem hiding this comment.
Looking at the module being used.. seems they made the rather unfortunate choice of splitting the URL like this. I thought it was smarter than that :-(
There was a problem hiding this comment.
What I would do is make the config use a url and then parse it on load. Something like this maybe?
var ghUrl = require('url').parse(auth.url || 'https://api.github.com');
github_params.host = ghUrl.host;
github_params.pathPrefix = ghUrl.path;
console.info('Connecting to: %s', ghUrl.format());| ``` | ||
| { | ||
| "username": "github-username", | ||
| "password": "github-password", |
There was a problem hiding this comment.
Would be better to use token for the GHE example, IMNSHO, since basic auth support is optional and token auth is generally preferred in all circumstances.
|
@nikbanerjee you should add your IBM email address to your github.com profile so that your commits are properly connected to you. |
Added option to connect to GitHub Enterprise by specifying GHE host in
.auth.json.If host name is not added then connection will default to
github.com.cc @rmg